<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>

</head>
<body>
     <!-- 组件绑定原生事件  .native的使用 -->
     <div id="app">
            <mycomponent @click.native="handclick2"></mycomponent>
    </div>
    <script>
         Vue.component('mycomponent',{
            template:`
            <div>
                <h2>{{content}}</h2>
                <button>按钮</button>
            </div>`,
           methods:{
               handclick(){
                   alert('inner click')
               }
           },
            data(){
                return{
                    content:'子组件'
                }
            }
        })
        var app = new Vue({
            el:"#app",
           methods:{
            handclick2(){
                   alert('out click')
               }
            }
        })
    </script>
</body>
</html>